#ifndef __MAINMENU_SCENE_H__
#define __MAINMENU_SCENE_H__

#include "cocos2d.h"
#include "WStringSupport.h"
#include "Audio.h"
#include "debug.h"
#include "UI.h"
#include "UIMainMenu.h"
#include "UISetting.h"

USING_NS_CC;

class SceneMainMenu : public cocos2d::Layer
{
	private:
	Label* pLabelStart;
	TTFConfig startTextConfig;
	Node* pBGSquare[10][5];
	MMBottomBar* pBGBottom;
	ParticleSystemQuad* pPSEmitter;
	vector<MMBigButton*> menuitems;

	int timeSegIndex;
	unsigned int nextEffectTime,curtime;
	vector<NoteManager::Note>::const_iterator *noteIters;

	bool isSettingOpen = false;
	UISetting* pSettingPanel = nullptr;

	public:
	static cocos2d::Scene* createScene();

	virtual bool init();

	//Scene scheme
	void createBG();
	void createMenu();
	void createParticle();
	void playRandomBGM();

	//Effect
	void squareEffect();
	void setNextEffectTime();
	void setNextEffectIter();

	//implement the "static create()" method manually
	CREATE_FUNC(SceneMainMenu);

	void update(float dt) override;
	
	//Event Actions
	void gotoMusicSelectScene();
	//void toggleSettingPanel();
};

#endif